<?php
$pid = empty($_GET['pid']) ? 0 : $_GET['pid'];
$id = empty($_GET['id']) ? 0 : intval($_GET['id']);

$oMenu = new Menu();

if($id > 0){
	$menu_info = $oMenu->get_row($id, '*');
	
	$menu_info['menu_tree'] = $oMenu->get_menu_tree_ul(0, '', $id); // 取分类树
	if($menu_info['pid'] > 0){
		$parent_menu = $oMenu->get_row($menu_info['pid'], 'id,name');
		$menu_info['parent_name'] = $__l[$parent_menu['name']];
	}else{
		$menu_info['parent_name'] = $__l['root'];
	}
	$menu_info['name'] = $__l[$menu_info['name']];
	$menu_info['power'] = $oMenu->formatPower_out($menu_info['power'], true);

}else{
	
	$menu_info = array(
		'pid'		=> $pid,
		'target'	=> 'iBody',
	);
	$menu_info['menu_tree'] = $oMenu->get_menu_tree_ul($pid); // 取分类树
	if($pid > 0){
		$parent_menu = $oMenu->get_row($pid, 'id, name');
		$menu_info['parent_name'] = $parent_menu['name'];
	}else{
		$menu_info['parent_name'] = $__l['root'];
	}
	
}

$menu_info['target_options'] = make_options(Statics::$target_arr, false, $menu_info['target']);

$vars['info'] = $menu_info;
?>